<?php
/**
 *  产品种类的操作 
 *  @author: zhulin
 *  @sincee:2012 5.8
 */
class Category_Show{
    
    const TABLE_NAME = 'product_type';
    const TABLE_NAME_SEARCH = 'type_brand';
    
    /**
     *单例对象
     */    
   public static $singletonObjects = array();
  /**
   * 构造函数
   * 
   */
   public function __construct(){
   
   }
   /**
    *
    * 单例
    */ 
   public static function getInstance( ){
		$className = __CLASS__;
		if( !isset( self::$singletonObjects[$className] ) )
		{
			self::$singletonObjects[$className] = new self( );
		}

		return self::$singletonObjects[$className];
	}
        
         /**
         * 获取产品大类的类型信息
         * @return array(
         * <pre>
         *      Tid    int      产品类型ID
         *      TNme   string   产品类型名称
         * 
         * 
         * </pre>
         * )
         */
       public function  _getCategory($TId ,$FId=false ){
           if( ! $FId ){
               $typeName = Common::getMysql()->get( self::TABLE_NAME , array( 'TId' => $TId ) );
           } 
           else{
               $typeName = Common::getMysql()->get( self::TABLE_NAME , array( 'TId' =>$FId ) );
           }
           return $typeName;
           
       }
        
        
        /**
         * 获取产品小类的类型信息
         * @return array(
         * <pre>
         *      Tid    int      产品类型ID
         *      TNme   string   产品类型名称
         * 
         * 
         * </pre>
         * )
         */
      public  function getCategory( $TId , $FId=false){
          if( $FId ){
               $typeName = Common::getMysql()->getList( self::TABLE_NAME , array('FId' => $FId));  
          }
          else{
              $typeName = Common::getMysql()->getList( self::TABLE_NAME , array('FId' => $TId));  
          }
              
              return  $typeName;
          
      }
    /**
     * 获取某个产品的类型
     */
    public function getCat( $BId ){
        $BCat = Common::getMysql()->get( self::TABLE_NAME , array( 'TId' =>$BId));
        return $BCat['TName'];
        
    }
   
      
     
}
